const Router = require('koa-router')

const adminController = require('../../controllers/admin')

const m = require('../../middlewares/admin_auth')


// 装载所有子路由
const router = new Router({
    prefix: '/admin/api/v1/admin'
})

//新增PC用户
router.post('/createByAdmin', m.auth, adminController.createByAdmin)
router.post('/getAdminList', m.auth, adminController.getAdminList)
router.get('/getAdminInfo/:id', m.auth, adminController.getAdminInfo)
router.post('/updateAdminInfo', m.auth, adminController.updateAdminInfo)
router.delete('/delAdminUser/:id', m.auth, adminController.delAdminUser)


router.post('/login', adminController.login)
// app端登录 （企业账号）
router.post('/app/login', adminController.appLogin)
// 退出
router.post('/logout', m.auth, adminController.logout)
// 个人信息
router.get('/info', m.auth, adminController.getUserInfo)

router.get('/getCaptcha',adminController.GetCaptcha)  //获取验证码

router.post('/changePass', m.auth, adminController.changePass)




module.exports = router